package com.hsc.yalebao.weight;

import android.app.Activity;
import android.app.Dialog;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;

public class CustomDialog extends Dialog
{
  private Activity context;

  public CustomDialog(Activity paramActivity)
  {
    super(paramActivity);
    this.context = paramActivity;
  }

  public CustomDialog(Activity paramActivity, int paramInt)
  {
    super(paramActivity, paramInt);
    this.context = paramActivity;
  }

  public CustomDialog create(View paramView, boolean paramBoolean)
  {
    ((LayoutInflater)this.context.getSystemService("layout_inflater"));
    CustomDialog localCustomDialog = new CustomDialog(this.context, 2131361805);
    localCustomDialog.setCanceledOnTouchOutside(paramBoolean);
    localCustomDialog.setContentView(paramView);
    Window localWindow = localCustomDialog.getWindow();
    localWindow.setGravity(17);
    WindowManager.LayoutParams localLayoutParams = localWindow.getAttributes();
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    this.context.getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);
    int i = localDisplayMetrics.widthPixels;
    int j = localDisplayMetrics.heightPixels;
    localLayoutParams.width = ((int)(0.7D * i));
    localLayoutParams.height = ((int)(0.6D * j));
    localLayoutParams.y = ((j - localLayoutParams.height) / 4);
    localWindow.setAttributes(localLayoutParams);
    return localCustomDialog;
  }

  public CustomDialog create(View paramView, boolean paramBoolean, float paramFloat1, float paramFloat2, float paramFloat3)
  {
    ((LayoutInflater)this.context.getSystemService("layout_inflater"));
    CustomDialog localCustomDialog = new CustomDialog(this.context, 2131361805);
    localCustomDialog.setCanceledOnTouchOutside(paramBoolean);
    localCustomDialog.setContentView(paramView);
    Window localWindow = localCustomDialog.getWindow();
    localWindow.setGravity(17);
    WindowManager.LayoutParams localLayoutParams = localWindow.getAttributes();
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    this.context.getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);
    int i = localDisplayMetrics.widthPixels;
    int j = localDisplayMetrics.heightPixels;
    localLayoutParams.width = ((int)(paramFloat1 * i));
    localLayoutParams.height = ((int)(paramFloat2 * j));
    localLayoutParams.y = ((int)(paramFloat3 * (j - localLayoutParams.height)));
    localWindow.setAttributes(localLayoutParams);
    return localCustomDialog;
  }

  public CustomDialog create(View paramView, boolean paramBoolean, float paramFloat, int paramInt)
  {
    ((LayoutInflater)this.context.getSystemService("layout_inflater"));
    CustomDialog localCustomDialog = new CustomDialog(this.context, 2131361805);
    localCustomDialog.setCanceledOnTouchOutside(paramBoolean);
    localCustomDialog.setContentView(paramView);
    Window localWindow = localCustomDialog.getWindow();
    localWindow.setGravity(17);
    WindowManager.LayoutParams localLayoutParams = localWindow.getAttributes();
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    this.context.getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);
    int i = localDisplayMetrics.widthPixels;
    int j = localDisplayMetrics.heightPixels;
    localLayoutParams.width = ((int)(paramFloat * i));
    localLayoutParams.height = paramInt;
    localLayoutParams.y = ((int)(0.1D * (j - localLayoutParams.height)));
    localWindow.setAttributes(localLayoutParams);
    return localCustomDialog;
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.weight.CustomDialog
 * JD-Core Version:    0.6.2
 */